import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import en from 'element-plus/es/locale/lang/en.mjs'
import 'element-plus/dist/index.css'
import App from '@/App.vue'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import router from '@/router'
import i18n from "@/locales/i18n.js";
import '../src/assets/init.css'
import icons from './plugins/icons.js'
import echarts from "@/plugins/echarts.js";
import VuePdf from 'vue3-pdfjs'
// 创建应用实例
const app = createApp(App)

// 创建并配置 Pinia
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

// 按顺序注册插件
app.use(pinia)
app.use(ElementPlus, {
    locale: localStorage.getItem('lang')==='zh'?zhCn:en,
})
app.use(router)
app.use(icons)
app.use(echarts)
app.use(i18n)
app.use(VuePdf)
// 挂载应用
app.mount('#app')
